package test;

import java.util.Date;

import org.hibernate.Session;

import com.loveazure.util.HibernateUtil;

public class EventManager {
	public static void main(String[] args) {
		EventManager mgr = new EventManager();
		// if (args[0].equals("store")) {
		mgr.createAndStoreEvent("My Event", new Date());
		// }
		HibernateUtil.getSessionFactory().close();
	}

	private void createAndStoreEvent(String title, Date theDate) {
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.beginTransaction();
		// UserEO user = new UserEO();
		// user.setName("default");
		// user.setLoginDate(new Date());
		// session.save(user);
		// System.out.println(user.getId());

		session.getTransaction().commit();
	}
}
